# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: Trương Xuân Tính <xuantinh at gmail dot com>

pkgname=ibus-unikey
pkgver=0.6.1
pkgrel=7
pkgdesc='IBus module for Vietnamese Keyboard'
arch=('loong64' 'x86_64')
license=('GPL')
url='https://code.google.com/archive/p/ibus-unikey/'
depends=('ibus')
makedepends=('intltool')
source=("https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/ibus-unikey/${pkgname}-${pkgver}.tar.gz"
        ibus-unikey-gcc6.patch)
md5sums=('3bae6df0d4609a8c438c246030b9a61e'
         'f44aa534c46438a26e3c4ad7434f3a4c')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 -i ../ibus-unikey-gcc6.patch # Fix build with GCC 6 (Gentoo)
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib/ibus \
    --with-gtk-version=3

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
